﻿using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using System;

namespace Camc.Quality.RecordTable.FormEntity
{
    public class 传感器变换器对应关系确认记录表 : TableBase
    {
        public 传感器变换器对应关系确认记录表(int serialNum, Guid workStepEntityId, Guid processesEntityId, int sort, string fisrtDrawingNum, string parentProductNum, string parentProductName,string secondDrawingNum)
        {
            SerialNum = serialNum;
            WorkStepEntityId = workStepEntityId;
            ProcessesEntityId = processesEntityId;
            Sort = sort;
            FisrtDrawingNum = fisrtDrawingNum;
            ParentProductNum = parentProductNum;
            ParentProductName = parentProductName;
            SecondDrawingNum = secondDrawingNum;
        }
        public override string FormName { get; protected set; } = "传感器变换器对应关系确认记录表";

        #region A4_变换器插头座
        public override string FisrtDrawingNum_DisplayName { get; protected set; } = "变换器插头座";
        public override bool FisrtDrawingNum_Show { get; protected set; } = true;
        #endregion
        #region  A2_电缆束1
        public override string ParentProductNum_DisplayName { get; protected set; } = "电缆束1";
        public override bool ParentProductNum_Show { get; protected set; } = true;
        public override int ParentProductNum_Property { get; protected set; } = 1;
        #endregion
        #region A3_电缆束2
        public override string ParentProductName_DisplayName { get; protected set; } = "电缆束2";
        public override bool ParentProductName_Show { get; protected set; } = true;   
        public override int ParentProductName_Property { get; protected set; } = 1;
        #endregion
        #region A6_传感器插头座
        public override string SecondDrawingNum_DisplayName { get; protected set; } = "传感器插头座";
        public override bool SecondDrawingNum_Show { get; protected set; } = true;
        #endregion
        /// <summary>
        /// 记录要求
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="recordLocation"></param>
        /// <param name="recordRequire"></param>
        /// <param name="recordStatus"></param>
        /// <param name="recordMainopoint"></param>
        /// <returns></returns>
        public RecordRequirementsEntity SetRecordRequirements(RecordRequirementsEntity entity, string recordLocation, string recordRequire, string recordStatus,string recordMainopoint)
        {
            entity.SetRecordLocation(recordLocation, "变换器代号", false, true, 0);
            entity.SetRecordStatus(recordStatus, "变换器编号",false,true,0);
            entity.SetRecordRequire(recordRequire, "传感器代号", false, true, 0);
            entity.SetRecordMainopoint(recordMainopoint, "传感器编号",false,true,0);
            return entity;
        }
        /// <summary>
        /// 实测值
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="confirmResult"></param>
        /// <returns></returns>
        public MeasuredResultEntity SetMeasuredResult(MeasuredResultEntity entity, string confirmResult)
        {
            entity.SetConfirmResult(confirmResult, "是否对应", true, true, 0);

            return entity;
        }
        /// <summary>
        /// 三检
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public InspectionSignatureEntity SetInspectionSignature(InspectionSignatureEntity entity)
        {
            entity.InspectionSignatureName = "三检";
            entity.SetFirstOperator(null, "操作者", true, true, 0, null, "操作者操作时间", true, true, 0);
            entity.SetSecondOperator(null, "互检者", true, true, 0, null, "互检者操作时间", true, true, 0);
            entity.SetThirdOperator(null, "检验员", true, true, 0, null, "检验员操作时间", true, true, 0);
            return entity;
        }
    }
}
